package com.wolfking.converter.transform.extend;

import com.google.common.collect.Lists;
import com.wolfking.converter.transform.AbstractExtendTransform;

import java.util.List;

public class StringSplitListTransform extends AbstractExtendTransform<List<String>> {

    private final String split;

    public StringSplitListTransform() {
        this(",");
    }

    public StringSplitListTransform(String split) {
        this.split = split;
    }

    @Override
    public List<String> transform(Object value) throws Exception {
        return Lists.newArrayList(value.toString().split(split));
    }
}
